package com.hgc.ch01.base;

/**
 * Created by 01367627 on 2019/6/14.
 */
public class NewThread {

    private static class ThreadExtends extends Thread {

        @Override
        public void run() {
            System.out.println(Thread.currentThread().getName() + " is Thread extends");
        }
    }

    private static class RunnableImpl implements Runnable {

        public void run() {
            System.out.println(Thread.currentThread().getName() + " is Thread implements");
        }
    }

    public static void main(String[] args) {
        Thread hgc = new ThreadExtends();
        hgc.setName("t1");
        hgc.start();
        Thread hgc1 = new Thread(new RunnableImpl());
        hgc1.setName("t2");
        hgc1.start();

    }

}
